/*******************************************************************************
 * Copyright (c) 2008 Sylvain Sicard.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v2.1
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * 
 * Contributors:
 *     Sylvain Sicard - initial API and implementation
 ******************************************************************************/
package fr.jade.fraclite.orb.names;

import fr.jade.fraclite.orb.common.AbstractName;
import fr.jade.fraclite.orb.common.api.Binder;

public class JGroupsName extends AbstractName {
  
  private static final long serialVersionUID = 1L;
  
  protected String groupId;
  
  public JGroupsName(long itfId, String signature, Binder naming, String groupId){
    super(itfId, signature, naming);
    this.groupId = groupId;
  }
  
  public String getGroupId() {
    return groupId;
  }

  @Override
  public boolean equals(Object o){
    if(o instanceof JGroupsName){
      return super.equals(o) &&
             ((JGroupsName)o).getGroupId().equals(groupId);
    }else{
      return false;
    }
  }
  
  public String toString(){
    return super.toString()+"::"+groupId;
  }
}
